export const excelColumns = [
  {
    header: '姓名',
    key: 'userName',
  },
  {
    header: '性别',
    key: 'genderName',
  },
  {
    header: '邮箱',
    key: 'email',
  },
  {
    header: '手机号',
    key: 'mobile',
  },
]
export const templateData = {
  userName: '测试姓名',
  genderName: '男',
  email: 'fuybooo@qq.com',
  mobile: '13566666666',
}
export function getValidation(label: string, config: any) {
  return {
    type: 'list',
    allowBlank: true,
    showInputMessage: true,
    showErrorMessage: true,
    showDropdown: true,
    errorTitle: '无效输入',
    inputMessage: `请选择${label}`,
    inputTitle: `${label}选择`,
    errorMessage: `${label}无效`,
    applyTo: 'A2:A1000',
    ...config,
  }
}

export const validationMap: any = {
  genderName: getValidation('性别', {
    formula1: ['男', '女', '未知'],
  }),
}
export const ruleMap: any = {
  userName: {
    maxLength: 40, // 英文名称长度可能较长
    required: true,
  },
  genderName: {
    type: 'valueSet',
    setCode: 'SYS_GENDER',
    valueCodeKey: 'gender',
  },
  email: {
    maxLength: 100,
  },
  mobile: {
    maxLength: 20,
  },
}
